const obj = {
    date: [1,2,3,4,5,6],
    teachers: {
      '盛老师': 'vue',
    },
    details: [
      {
        title: 'vue01组件化',
        content: 'Vue入门',
        catg: 'vue'
      },
      {
        title: 'vue02 最佳实践',
        content: 'Vue最佳实践',
        catg: 'vue'
      },
      {
        title: 'vue03原理源码',
        content: 'vue03原理源码',
        catg: 'vue'
      },
      {
        title: 'vue04 docker部署',
        content: 'Vue + docker部署',
        catg: 'vue'
      },
  
    ]
  }
  const catgTeachers = {}
  Object.entries(obj.teachers).forEach(val => {
    const [ name, catg ] = val
    catg.split(',').forEach(v => {
      catgTeachers[v] = name
    })
  })
  obj.details.map(v => {
    v.teacher = catgTeachers[v.catg]
    return v
  })
  console.log(obj)
  export default obj
  